//
//  leve2Layer.m
//  mmtouch
//
//  Created by xing lion on 11-9-7.
//  Copyright 2011年 tencent. All rights reserved.
//

#import "leve2Layer.h"
#import "PlayLayer.h"
#import "SceneManager.h"

@implementation leve2Layer


-(void)gotoPlay:(id)sender
{
    int picnum = [sender tag];
    
	CCLayer *layer = [PlayLayer node];
    [(PlayLayer*)layer gotonextMM :picnum];
	[SceneManager go: layer];
    
}


-(void)makebutton1
{
    
    CCSprite* menupic = [CCSprite spriteWithFile:@"41.png"];
    
    CCMenuItemSprite *spmen1 = [CCMenuItemSprite itemFromNormalSprite:menupic selectedSprite:nil target:self selector:@selector(gotoPlay:)];
    
    [spmen1 setTag:41];
    
    CCSprite* menupic2 = [CCSprite spriteWithFile:@"42.png"];
    
    CCMenuItemSprite *spmen2 = [CCMenuItemSprite itemFromNormalSprite:menupic2 selectedSprite:nil target:self selector:@selector(gotoPlay:)];
    
    [spmen2 setTag:42];
    
    CCSprite* menupic3 = [CCSprite spriteWithFile:@"43.png"];
    
    CCMenuItemSprite *spmen3 = [CCMenuItemSprite itemFromNormalSprite:menupic3 selectedSprite:nil target:self selector:@selector(gotoPlay:)];
    
    
    [spmen3 setTag:43];
    CCSprite* menupic4 = [CCSprite spriteWithFile:@"44.png"];
    
    CCMenuItemSprite *spmen4 = [CCMenuItemSprite itemFromNormalSprite:menupic4 selectedSprite:nil target:self selector:@selector(gotoPlay:)];
    
    [spmen4 setTag:44];
    
    CCSprite* menupic5 = [CCSprite spriteWithFile:@"45.png"];
    
    CCMenuItemSprite *spmen5 = [CCMenuItemSprite itemFromNormalSprite:menupic5 selectedSprite:nil target:self selector:@selector(gotoPlay:)];
    
    [spmen5 setTag:45];
    
    CCMenu* menu = [CCMenu menuWithItems:spmen1,spmen2,spmen3,spmen4,spmen5, nil];
    
    
    [menu alignItemsHorizontallyWithPadding:10];
    
    [menu setPosition:ccp(160, 450)];
    
    [self addChild:menu];
    
}

-(void)makebutton2
{
    
    
    CCSprite* menupic = [CCSprite spriteWithFile:@"46.png"];
    
    CCMenuItemSprite *spmen1 = [CCMenuItemSprite itemFromNormalSprite:menupic selectedSprite:nil target:self selector:@selector(gotoPlay:)];
    
    [spmen1 setTag:46];
    
    CCSprite* menupic2 = [CCSprite spriteWithFile:@"47.png"];
    
    CCMenuItemSprite *spmen2 = [CCMenuItemSprite itemFromNormalSprite:menupic2 selectedSprite:nil target:self selector:@selector(gotoPlay:)];
    
    
    [spmen2 setTag:47];
    CCSprite* menupic3 = [CCSprite spriteWithFile:@"48.png"];
    
    CCMenuItemSprite *spmen3 = [CCMenuItemSprite itemFromNormalSprite:menupic3 selectedSprite:nil target:self selector:@selector(gotoPlay:)];
    
    [spmen3 setTag:48];
    CCSprite* menupic4 = [CCSprite spriteWithFile:@"49.png"];
    
    CCMenuItemSprite *spmen4 = [CCMenuItemSprite itemFromNormalSprite:menupic4 selectedSprite:nil target:self selector:@selector(gotoPlay:)];
    
    [spmen1 setTag:49];
    CCSprite* menupic5 = [CCSprite spriteWithFile:@"50.png"];
    
    CCMenuItemSprite *spmen5 = [CCMenuItemSprite itemFromNormalSprite:menupic5 selectedSprite:nil target:self selector:@selector(gotoPlay:)];
    
    [spmen5 setTag:50];
    
    CCMenu* menu = [CCMenu menuWithItems:spmen1,spmen2,spmen3,spmen4,spmen5, nil];
    
    
    [menu alignItemsHorizontallyWithPadding:10];
    
    [menu setPosition:ccp(160, 390)];
    
    [self addChild:menu];
}

-(void)makebutton3
{
    CCSprite* menupic = [CCSprite spriteWithFile:@"51.png"];
    
    CCMenuItemSprite *spmen1 = [CCMenuItemSprite itemFromNormalSprite:menupic selectedSprite:nil target:self selector:@selector(gotoPlay:)];
    
    [spmen1 setTag:51];
    
    CCSprite* menupic2 = [CCSprite spriteWithFile:@"52.png"];
    
    CCMenuItemSprite *spmen2 = [CCMenuItemSprite itemFromNormalSprite:menupic2 selectedSprite:nil target:self selector:@selector(gotoPlay:)];
    
    [spmen2 setTag:52];
    
    CCSprite* menupic3 = [CCSprite spriteWithFile:@"53.png"];
    
    CCMenuItemSprite *spmen3 = [CCMenuItemSprite itemFromNormalSprite:menupic3 selectedSprite:nil target:self selector:@selector(gotoPlay:)];
    
    
    [spmen3 setTag:53];
    CCSprite* menupic4 = [CCSprite spriteWithFile:@"54.png"];
    
    CCMenuItemSprite *spmen4 = [CCMenuItemSprite itemFromNormalSprite:menupic4 selectedSprite:nil target:self selector:@selector(gotoPlay:)];
    
    [spmen4 setTag:54];
    
    CCSprite* menupic5 = [CCSprite spriteWithFile:@"55.png"];
    
    CCMenuItemSprite *spmen5 = [CCMenuItemSprite itemFromNormalSprite:menupic5 selectedSprite:nil target:self selector:@selector(gotoPlay:)];
    
    [spmen5 setTag:55];
    
    CCMenu* menu = [CCMenu menuWithItems:spmen1,spmen2,spmen3,spmen4,spmen5, nil];
    
    
    [menu alignItemsHorizontallyWithPadding:10];
    
    [menu setPosition:ccp(160, 330)];
    
    [self addChild:menu];
}

-(void)makebutton4
{
    CCSprite* menupic = [CCSprite spriteWithFile:@"56.png"];
    
    CCMenuItemSprite *spmen1 = [CCMenuItemSprite itemFromNormalSprite:menupic selectedSprite:nil target:self selector:@selector(gotoPlay:)];
    
    [spmen1 setTag:56];
    
    CCSprite* menupic2 = [CCSprite spriteWithFile:@"57.png"];
    
    CCMenuItemSprite *spmen2 = [CCMenuItemSprite itemFromNormalSprite:menupic2 selectedSprite:nil target:self selector:@selector(gotoPlay:)];
    
    [spmen2 setTag:57];
    
    CCSprite* menupic3 = [CCSprite spriteWithFile:@"58.png"];
    
    CCMenuItemSprite *spmen3 = [CCMenuItemSprite itemFromNormalSprite:menupic3 selectedSprite:nil target:self selector:@selector(gotoPlay:)];
    
    [spmen3 setTag:58];
    
    CCSprite* menupic4 = [CCSprite spriteWithFile:@"59.png"];
    
    CCMenuItemSprite *spmen4 = [CCMenuItemSprite itemFromNormalSprite:menupic4 selectedSprite:nil target:self selector:@selector(gotoPlay:)];
    
    
    [spmen4 setTag:59];
    CCSprite* menupic5 = [CCSprite spriteWithFile:@"60.png"];
    
    CCMenuItemSprite *spmen5 = [CCMenuItemSprite itemFromNormalSprite:menupic5 selectedSprite:nil target:self selector:@selector(gotoPlay:)];
    
    [spmen5 setTag:60];
    
    CCMenu* menu = [CCMenu menuWithItems:spmen1,spmen2,spmen3,spmen4,spmen5, nil];
    
    
    [menu alignItemsHorizontallyWithPadding:10];
    
    [menu setPosition:ccp(160, 270)];
    
    [self addChild:menu];
}

-(void)makebutton5
{
    CCSprite* menupic = [CCSprite spriteWithFile:@"61.png"];
    
    CCMenuItemSprite *spmen1 = [CCMenuItemSprite itemFromNormalSprite:menupic selectedSprite:nil target:self selector:@selector(gotoPlay:)];
    
    [spmen1 setTag:61];
    
    CCSprite* menupic2 = [CCSprite spriteWithFile:@"62.png"];
    
    CCMenuItemSprite *spmen2 = [CCMenuItemSprite itemFromNormalSprite:menupic2 selectedSprite:nil target:self selector:@selector(gotoPlay:)];
    
    [spmen2 setTag:62];
    
    CCSprite* menupic3 = [CCSprite spriteWithFile:@"63.png"];
    
    CCMenuItemSprite *spmen3 = [CCMenuItemSprite itemFromNormalSprite:menupic3 selectedSprite:nil target:self selector:@selector(gotoPlay:)];
    
    
    [spmen3 setTag:63];
    CCSprite* menupic4 = [CCSprite spriteWithFile:@"64.png"];
    
    CCMenuItemSprite *spmen4 = [CCMenuItemSprite itemFromNormalSprite:menupic4 selectedSprite:nil target:self selector:@selector(gotoPlay:)];
    
    
    [spmen4 setTag:64];
    CCSprite* menupic5 = [CCSprite spriteWithFile:@"65.png"];
    
    CCMenuItemSprite *spmen5 = [CCMenuItemSprite itemFromNormalSprite:menupic5 selectedSprite:nil target:self selector:@selector(gotoPlay:)];
    
    [spmen5 setTag:65];
    
    CCMenu* menu = [CCMenu menuWithItems:spmen1,spmen2,spmen3,spmen4,spmen5, nil];
    
    
    [menu alignItemsHorizontallyWithPadding:10];
    
    [menu setPosition:ccp(160, 210)];
    
    [self addChild:menu];
}

-(void)makebutton6
{
    CCSprite* menupic = [CCSprite spriteWithFile:@"66.png"];
    
    CCMenuItemSprite *spmen1 = [CCMenuItemSprite itemFromNormalSprite:menupic selectedSprite:nil target:self selector:@selector(gotoPlay:)];
    
    [spmen1 setTag:66];
    CCSprite* menupic2 = [CCSprite spriteWithFile:@"67.png"];
    
    CCMenuItemSprite *spmen2 = [CCMenuItemSprite itemFromNormalSprite:menupic2 selectedSprite:nil target:self selector:@selector(gotoPlay:)];
    
    [spmen2 setTag:67];
    
    CCSprite* menupic3 = [CCSprite spriteWithFile:@"68.png"];
    
    CCMenuItemSprite *spmen3 = [CCMenuItemSprite itemFromNormalSprite:menupic3 selectedSprite:nil target:self selector:@selector(gotoPlay:)];
    
    [spmen3 setTag:68];
    CCSprite* menupic4 = [CCSprite spriteWithFile:@"69.png"];
    
    CCMenuItemSprite *spmen4 = [CCMenuItemSprite itemFromNormalSprite:menupic4 selectedSprite:nil target:self selector:@selector(gotoPlay:)];
    
    [spmen4 setTag:69];
    CCSprite* menupic5 = [CCSprite spriteWithFile:@"70.png"];
    
    CCMenuItemSprite *spmen5 = [CCMenuItemSprite itemFromNormalSprite:menupic5 selectedSprite:nil target:self selector:@selector(gotoPlay:)];
    
    [spmen5 setTag:70];
    
    
    CCMenu* menu = [CCMenu menuWithItems:spmen1,spmen2,spmen3,spmen4,spmen5, nil];
    
    
    [menu alignItemsHorizontallyWithPadding:10];
    
    [menu setPosition:ccp(160, 150)];
    
    [self addChild:menu];
}

-(void)makebutton7
{
    CCSprite* menupic = [CCSprite spriteWithFile:@"71.png"];
    
    CCMenuItemSprite *spmen1 = [CCMenuItemSprite itemFromNormalSprite:menupic selectedSprite:nil target:self selector:@selector(gotoPlay:)];
    
    [spmen1 setTag:71];
    
    CCSprite* menupic2 = [CCSprite spriteWithFile:@"72.png"];
    
    CCMenuItemSprite *spmen2 = [CCMenuItemSprite itemFromNormalSprite:menupic2 selectedSprite:nil target:self selector:@selector(gotoPlay:)];
    
     [spmen2 setTag:72];
    CCSprite* menupic3 = [CCSprite spriteWithFile:@"73.png"];
    
    CCMenuItemSprite *spmen3 = [CCMenuItemSprite itemFromNormalSprite:menupic3 selectedSprite:nil target:self selector:@selector(gotoPlay:)];
    
     [spmen3 setTag:73];
    
    CCSprite* menupic4 = [CCSprite spriteWithFile:@"74.png"];
    
    CCMenuItemSprite *spmen4 = [CCMenuItemSprite itemFromNormalSprite:menupic4 selectedSprite:nil target:self selector:@selector(gotoPlay:)];
    
     [spmen4 setTag:74];
    
    CCSprite* menupic5 = [CCSprite spriteWithFile:@"75.png"];
    
    CCMenuItemSprite *spmen5 = [CCMenuItemSprite itemFromNormalSprite:menupic5 selectedSprite:nil target:self selector:@selector(gotoPlay:)];
    
     [spmen5 setTag:75];
    
    CCMenu* menu = [CCMenu menuWithItems:spmen1,spmen2,spmen3,spmen4,spmen5, nil];
    
    
    [menu alignItemsHorizontallyWithPadding:10];
    
    [menu setPosition:ccp(160, 90)];
    
    [self addChild:menu];
}

-(void)makebutton8
{
    CCSprite* menupic = [CCSprite spriteWithFile:@"76.png"];
    
    CCMenuItemSprite *spmen1 = [CCMenuItemSprite itemFromNormalSprite:menupic selectedSprite:nil target:self selector:@selector(gotoPlay:)];
    
     [spmen1 setTag:76];
    
    CCSprite* menupic2 = [CCSprite spriteWithFile:@"77.png"];
    
    CCMenuItemSprite *spmen2 = [CCMenuItemSprite itemFromNormalSprite:menupic2 selectedSprite:nil target:self selector:@selector(gotoPlay:)];
    
     [spmen2 setTag:77];
    
    
    
    CCSprite* menupic3 = [CCSprite spriteWithFile:@"78.png"];
    
    CCMenuItemSprite *spmen3 = [CCMenuItemSprite itemFromNormalSprite:menupic3 selectedSprite:nil target:self selector:@selector(gotoPlay:)];
    
     [spmen3 setTag:78];
    
    CCSprite* menupic4 = [CCSprite spriteWithFile:@"79.png"];
    
    CCMenuItemSprite *spmen4 = [CCMenuItemSprite itemFromNormalSprite:menupic4 selectedSprite:nil target:self selector:@selector(gotoPlay:)];
    
     [spmen4 setTag:79];
    CCSprite* menupic5 = [CCSprite spriteWithFile:@"80.png"];
    
    CCMenuItemSprite *spmen5 = [CCMenuItemSprite itemFromNormalSprite:menupic5 selectedSprite:nil target:self selector:@selector(gotoPlay:)];
    
     [spmen5 setTag:80];
    CCMenu* menu = [CCMenu menuWithItems:spmen1,spmen2,spmen3,spmen4,spmen5, nil];
    
    
    [menu alignItemsHorizontallyWithPadding:10];
    
    [menu setPosition:ccp(160, 30)];
    
    [self addChild:menu];
}

- (id)init
{
    self = [super init];
    if (self) {
        // Initialization code here.
        //        
        //        CCSprite* sp = [CCSprite spriteWithFile:@"1.jpg"];
        //        
        //        sp.position = ccp(160, 240);
        //        
        //        [self addChild:sp];
        
        [self makebutton1];
        [self makebutton2];
        [self makebutton3];
        [self makebutton4];
        [self makebutton5];
        [self makebutton6];
        [self makebutton7];
        [self makebutton8];
        
        
    }
    
    return self;
}



@end
